<%--
  Created by IntelliJ IDEA.
  User: veneno
  Date: 2020/11/18
  Time: 9:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>图书显示页面</title>
    <script src="js/jquery.min.js"></script>
    <link rel="stylesheet" href="css/default.css">
    <link rel="stylesheet" href="css/bootstrap-table.css">
    <link rel="stylesheet" href="css/bootstrap-table.min.css">
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-table.min.js"></script>
    <script src="js/bootstrap-table-zh-CN.min.js"></script>
    <style>
        .main-body{
            margin:0 auto;
            width:60%;
            top:60px;
            position: relative
        }
        label{
            font-size: 14px;
            font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
        }
        tr th{
            font-weight: bold;
            font-size: 14px;
        }
    </style>
</head>

<body>

<header>
    <nav class="headerwrapper nav navbar-inverse container-fluid">
        <div class="row">
            <a href="show.jsp" class="navbar-brand hidden-sm col-md-2 col-md-offset-2" >欢迎使用图书管理系统</a>

            <ul class="nav navbar-nav navbar-right col-md-2" style="margin: 10px">
                <li>
                    <button class="btn btn-info" onclick="location.href='login.jsp'">登录</button>
                </li>
            </ul>
        </div>

    </nav>
</header>
<br>

<section>
    <div class="main-body" >
        <div class="panel panel-primary">
            <div class="panel-heading">查询</div>
            <div class="panel-body">
                <div class="container-fluid">
                    <div class="col-md-12">
                        <table class="table table-bordered" id="table"></table>
                    </div>
                </div>
            </div>
        </div>

    </div>
</section>


<script>
    $("#table").bootstrapTable({
        url:"getAllBooks",
        method:"get",
        sidePagination: "client",
        cache:false,
        striped:true,
        pagination:true,
        sortable:true,
        sortOrder:"asc",
        search:true,
        showRefresh: true,
        clickToSelect:true,
        showToggle: true,
        columns:[
            { field: 'SerialNumber', title: '序号',
                formatter: function (value, row, index) {
                    return index+1;
                }
            },
            { field: 'isbn', title: 'ISBN' },
            { field: 'bookName', title: '书名' },
            { field: 'author', title: '作者' },
            { field: 'type', title: '类型' },
            { field: 'press', title: '出版社' },
            { field: 'date', title: '日期' },
            { field: 'count', title: '数量' },
            { field: 'price', title: '金额' },
        ]
    })
</script>

</body>
</html>

